<?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
	
<script type="text/javascript">

	$(document).ready(function() {
		$("form#forget_password_form input[id='send_request_password']").click(function() {
		  	ISS.Ajax.Caller.submit(ISS.lang.getBasePath()+'index.php/member/login/ajax_forget_password/', $("#forget_password_form"));
		});
	}); 

	function closePopUp () {
		ISS.Popup.Windows.Hide_Modal();
	}
</script>

<div id='forget_password'>
	<form id="forget_password_form" action="#" method="post">
		<table>
			<tr>
				<td>ชื่อ</td>
				<td>
					<input id="forget_password_username" type="text" name="txtForgetUsername" 
					    dojoType="dijit.form.ValidationTextBox"
					    style="width: 150px;" 
					    trim="true"
					    required="true"
					    invalidMessage="กรุณาระบุชื่อเข้าสู่ระบบ" />
				</td>
				<td>
					<div id='errForgetUsername' class='loginBlockError'>
						<?php echo (empty ($errors['txtForgetUsername'])) ? '' : $errors['txtForgetUsername']; ?>
					</div>
				</td>				
			</tr>
			<tr>
				<td>เลือกคำถาม</td>
				<td>
					<select
						dojoType="dijit.form.FilteringSelect"
						name="cboForgetQuestion"
						style="width: 150px;" 
						value="<?php echo html::specialchars($form['cboForgetQuestion']) ?>"
						invalidMessage="กรณาระบุคำถามกันลืม"
						autoComplete="true">
						<?php foreach ($master_questions as $question): ?>
						<option value="<?php echo $question['id']; ?>"><?php echo html::specialchars($question['title']); ?></option>
					    <?php endforeach ?>							
					</select>			
				</td>
				<td>
					<div id='errForgetQuestion' class='loginBlockError'>
						<?php echo (empty ($errors['cboForgetQuestion'])) ? '' : $errors['cboForgetQuestion']; ?>
					</div>
				</td>
			</tr>
			<tr>
				<td>คำตอบ</td>
				<td>
					<input id="forget_password_answer" type="text" name="txtForgetAnswer" 
					    dojoType="dijit.form.ValidationTextBox"
					    style="width: 150px;" 
					    trim="true"
					    required="true"
					    invalidMessage="กรุณาระบุคำตอบ" />
			   </td>
			   <td>
					<div id='errForgetAnswer' class='loginBlockError'>
						<?php echo (empty ($errors['txtForgetAnswer'])) ? '' : $errors['txtForgetAnswer']; ?>
					</div>
				</td>
			</tr>
			<tr>
				<td>
				</td>
				<td>
					<input type="button" id="send_request_password" value="ส่งคำร้อง">
					<input type="button" id="close_forget_password_popup" onclick="closePopUp();" value="ปิด">
				</td>
				<td></td>
			</tr>
			<tr>
				<td colspan="3">
					<div id="forget_password_message" class="loginBlockError">ระบบจะส่งข้อมูลรหัสผ่านไปให้ทางอีเมลล์ที่ได้ลงทะเบียนไว้</div>
				</td>
			</tr>
		</table>
	</form>
</div>
